-- GENERATED SPELL FOR [Tidewalker Shaman] --


function spell0_21226(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(39066,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21226', 0, 1)
end

function spell1_21226(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(39065,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21226', 611, 1)
end

function spell2_21226(pUnit, Event) --@Lightning Shield,n/a--
pUnit:FullCastSpellOnTarget(39067,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21226', 0, 1)
end

function Sorts_21226(pUnit, Event)
local choix_sorts_21226 = math.random(0, 2)
if choix_sorts_21226 == 0 then
pUnit:RegisterEvent('spell0_21226', 1, 1)
end
if choix_sorts_21226 == 1 then
pUnit:RegisterEvent('spell1_21226', 1, 1)
end
if choix_sorts_21226 == 2 then
pUnit:RegisterEvent('spell2_21226', 1, 1)
end
end

function mob21226_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21226', math.random(1500, 3000), 1)
end

function mob21226_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21226_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21226_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21226, 1, 'mob21226_Action')
RegisterUnitEvent(21226, 2, 'mob21226_Leave')
RegisterUnitEvent(21226, 3, 'mob21226_Kill')
RegisterUnitEvent(21226, 4, 'mob21226_Die')
